package cn.itcast.web.mq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MailProducer {

	@Autowired
	private RabbitTemplate rabbitTemplate;

	/**
	 * 消息方法
	 */
	public void sendMag(Object obj) {
		rabbitTemplate.convertAndSend("user.insert",obj);
	}


	public void sendDelivery(Object obj){
		rabbitTemplate.convertAndSend("user.delivery",obj);
	}

	public void sendSms(Object obj){
		rabbitTemplate.convertAndSend("user.sms",obj);
	}
}
